home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue57 / Clinic / ActiveX_TLB.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-03-24  |  23.9 KB  |  565 lines

  1. unit ActiveX_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                    
  5. // -------                                                                    
  6. // The types declared in this file were generated from data read from a       
  7. // Type Library. If this type library is explicitly or indirectly (via        
  8. // another type library referring to this type library) re-imported, or the   
  9. // 'Refresh' command of the Type Library Editor activated while editing the   
  10. // Type Library, the contents of this file will be regenerated and all        
  11. // manual modifications will be lost.                                         
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.88.1.0.1.0  $
  15. // File generated on 24/03/2000 11:34:09 from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: D:\Magazines\Work In Progress\57 - May 00\Clinic\Files\ActiveX.tlb (1)
  19. // IID\LCID: {58A2AB0B-0164-11D4-96EC-0060978E1359}\0
  20. // Helpfile: 
  21. // DepndLst: 
  22. //   (1) v2.0 stdole, (C:\WINDOWS\SYSTEM\STDOLE2.TLB)
  23. //   (2) v4.0 StdVCL, (C:\WINDOWS\SYSTEM\STDVCL40.DLL)
  24. // ************************************************************************ //
  25. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
  26. interface
  27.  
  28. uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
  29.  
  30. // *********************************************************************//
  31. // GUIDS declared in the TypeLibrary. Following prefixes are used:        
  32. //   Type Libraries     : LIBID_xxxx                                      
  33. //   CoClasses          : CLASS_xxxx                                      
  34. //   DISPInterfaces     : DIID_xxxx                                       
  35. //   Non-DISP interfaces: IID_xxxx                                        
  36. // *********************************************************************//
  37. const
  38.   // TypeLibrary Major and minor versions
  39.   ActiveXMajorVersion = 1;
  40.   ActiveXMinorVersion = 0;
  41.  
  42.   LIBID_ActiveX: TGUID = '{58A2AB0B-0164-11D4-96EC-0060978E1359}';
  43.  
  44.   IID_IActiveFormX: TGUID = '{58A2AB0C-0164-11D4-96EC-0060978E1359}';
  45.   DIID_IActiveFormXEvents: TGUID = '{58A2AB0E-0164-11D4-96EC-0060978E1359}';
  46.   CLASS_ActiveFormX: TGUID = '{58A2AB10-0164-11D4-96EC-0060978E1359}';
  47.   IID_IButtonX: TGUID = '{58A2AB1F-0164-11D4-96EC-0060978E1359}';
  48.   DIID_IButtonXEvents: TGUID = '{58A2AB21-0164-11D4-96EC-0060978E1359}';
  49.   CLASS_ButtonX: TGUID = '{58A2AB23-0164-11D4-96EC-0060978E1359}';
  50.  
  51. // *********************************************************************//
  52. // Declaration of Enumerations defined in Type Library                    
  53. // *********************************************************************//
  54. // Constants for enum TxActiveFormBorderStyle
  55. type
  56.   TxActiveFormBorderStyle = TOleEnum;
  57. const
  58.   afbNone = $00000000;
  59.   afbSingle = $00000001;
  60.   afbSunken = $00000002;
  61.   afbRaised = $00000003;
  62.  
  63. // Constants for enum TxPrintScale
  64. type
  65.   TxPrintScale = TOleEnum;
  66. const
  67.   poNone = $00000000;
  68.   poProportional = $00000001;
  69.   poPrintToFit = $00000002;
  70.  
  71. // Constants for enum TxMouseButton
  72. type
  73.   TxMouseButton = TOleEnum;
  74. const
  75.   mbLeft = $00000000;
  76.   mbRight = $00000001;
  77.   mbMiddle = $00000002;
  78.  
  79. // Constants for enum TxDragMode
  80. type
  81.   TxDragMode = TOleEnum;
  82. const
  83.   dmManual = $00000000;
  84.   dmAutomatic = $00000001;
  85.  
  86. type
  87.  
  88. // *********************************************************************//
  89. // Forward declaration of types defined in TypeLibrary                    
  90. // *********************************************************************//
  91.   IActiveFormX = interface;
  92.   IActiveFormXDisp = dispinterface;
  93.   IActiveFormXEvents = dispinterface;
  94.   IButtonX = interface;
  95.   IButtonXDisp = dispinterface;
  96.   IButtonXEvents = dispinterface;
  97.  
  98. // *********************************************************************//
  99. // Declaration of CoClasses defined in Type Library                       
  100. // (NOTE: Here we map each CoClass to its Default Interface)              
  101. // *********************************************************************//
  102.   ActiveFormX = IActiveFormX;
  103.   ButtonX = IButtonX;
  104.  
  105.  
  106. // *********************************************************************//
  107. // Declaration of structures, unions and aliases.                         
  108. // *********************************************************************//
  109.   PPUserType1 = ^IFontDisp; {*}
  110.  
  111.  
  112. // *********************************************************************//
  113. // Interface: IActiveFormX
  114. // Flags:     (4416) Dual OleAutomation Dispatchable
  115. // GUID:      {58A2AB0C-0164-11D4-96EC-0060978E1359}
  116. // *********************************************************************//
  117.   IActiveFormX = interface(IDispatch)
  118.     ['{58A2AB0C-0164-11D4-96EC-0060978E1359}']
  119.     function  Get_Visible: WordBool; safecall;
  120.     procedure Set_Visible(Value: WordBool); safecall;
  121.     function  Get_AutoScroll: WordBool; safecall;
  122.     procedure Set_AutoScroll(Value: WordBool); safecall;
  123.     function  Get_AutoSize: WordBool; safecall;
  124.     procedure Set_AutoSize(Value: WordBool); safecall;
  125.     function  Get_AxBorderStyle: TxActiveFormBorderStyle; safecall;
  126.     procedure Set_AxBorderStyle(Value: TxActiveFormBorderStyle); safecall;
  127.     function  Get_Caption: WideString; safecall;
  128.     procedure Set_Caption(const Value: WideString); safecall;
  129.     function  Get_Color: OLE_COLOR; safecall;
  130.     procedure Set_Color(Value: OLE_COLOR); safecall;
  131.     function  Get_Font: IFontDisp; safecall;
  132.     procedure _Set_Font(const Value: IFontDisp); safecall;
  133.     procedure Set_Font(var Value: IFontDisp); safecall;
  134.     function  Get_KeyPreview: WordBool; safecall;
  135.     procedure Set_KeyPreview(Value: WordBool); safecall;
  136.     function  Get_PixelsPerInch: Integer; safecall;
  137.     procedure Set_PixelsPerInch(Value: Integer); safecall;
  138.     function  Get_PrintScale: TxPrintScale; safecall;
  139.     procedure Set_PrintScale(Value: TxPrintScale); safecall;
  140.     function  Get_Scaled: WordBool; safecall;
  141.     procedure Set_Scaled(Value: WordBool); safecall;
  142.     function  Get_Active: WordBool; safecall;
  143.     function  Get_DropTarget: WordBool; safecall;
  144.     procedure Set_DropTarget(Value: WordBool); safecall;
  145.     function  Get_HelpFile: WideString; safecall;
  146.     procedure Set_HelpFile(const Value: WideString); safecall;
  147.     function  Get_DoubleBuffered: WordBool; safecall;
  148.     procedure Set_DoubleBuffered(Value: WordBool); safecall;
  149.     function  Get_VisibleDockClientCount: Integer; safecall;
  150.     function  Get_Enabled: WordBool; safecall;
  151.     procedure Set_Enabled(Value: WordBool); safecall;
  152.     function  Get_Cursor: Smallint; safecall;
  153.     procedure Set_Cursor(Value: Smallint); safecall;
  154.     function  Get_MyNewFormProp: WideString; safecall;
  155.     procedure Set_MyNewFormProp(const Value: WideString); safecall;
  156.     property Visible: WordBool read Get_Visible write Set_Visible;
  157.     property AutoScroll: WordBool read Get_AutoScroll write Set_AutoScroll;
  158.     property AutoSize: WordBool read Get_AutoSize write Set_AutoSize;
  159.     property AxBorderStyle: TxActiveFormBorderStyle read Get_AxBorderStyle write Set_AxBorderStyle;
  160.     property Caption: WideString read Get_Caption write Set_Caption;
  161.     property Color: OLE_COLOR read Get_Color write Set_Color;
  162.     property Font: IFontDisp read Get_Font write _Set_Font;
  163.     property KeyPreview: WordBool read Get_KeyPreview write Set_KeyPreview;
  164.     property PixelsPerInch: Integer read Get_PixelsPerInch write Set_PixelsPerInch;
  165.     property PrintScale: TxPrintScale read Get_PrintScale write Set_PrintScale;
  166.     property Scaled: WordBool read Get_Scaled write Set_Scaled;
  167.     property Active: WordBool read Get_Active;
  168.     property DropTarget: WordBool read Get_DropTarget write Set_DropTarget;
  169.     property HelpFile: WideString read Get_HelpFile write Set_HelpFile;
  170.     property DoubleBuffered: WordBool read Get_DoubleBuffered write Set_DoubleBuffered;
  171.     property VisibleDockClientCount: Integer read Get_VisibleDockClientCount;
  172.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  173.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  174.     property MyNewFormProp: WideString read Get_MyNewFormProp write Set_MyNewFormProp;
  175.   end;
  176.  
  177. // *********************************************************************//
  178. // DispIntf:  IActiveFormXDisp
  179. // Flags:     (4416) Dual OleAutomation Dispatchable
  180. // GUID:      {58A2AB0C-0164-11D4-96EC-0060978E1359}
  181. // *********************************************************************//
  182.   IActiveFormXDisp = dispinterface
  183.     ['{58A2AB0C-0164-11D4-96EC-0060978E1359}']
  184.     property Visible: WordBool dispid 1;
  185.     property AutoScroll: WordBool dispid 2;
  186.     property AutoSize: WordBool dispid 3;
  187.     property AxBorderStyle: TxActiveFormBorderStyle dispid 4;
  188.     property Caption: WideString dispid -518;
  189.     property Color: OLE_COLOR dispid -501;
  190.     property Font: IFontDisp dispid -512;
  191.     property KeyPreview: WordBool dispid 5;
  192.     property PixelsPerInch: Integer dispid 6;
  193.     property PrintScale: TxPrintScale dispid 7;
  194.     property Scaled: WordBool dispid 8;
  195.     property Active: WordBool readonly dispid 9;
  196.     property DropTarget: WordBool dispid 10;
  197.     property HelpFile: WideString dispid 11;
  198.     property DoubleBuffered: WordBool dispid 12;
  199.     property VisibleDockClientCount: Integer readonly dispid 13;
  200.     property Enabled: WordBool dispid -514;
  201.     property Cursor: Smallint dispid 14;
  202.     property MyNewFormProp: WideString dispid 15;
  203.   end;
  204.  
  205. // *********************************************************************//
  206. // DispIntf:  IActiveFormXEvents
  207. // Flags:     (0)
  208. // GUID:      {58A2AB0E-0164-11D4-96EC-0060978E1359}
  209. // *********************************************************************//
  210.   IActiveFormXEvents = dispinterface
  211.     ['{58A2AB0E-0164-11D4-96EC-0060978E1359}']
  212.     procedure OnActivate; dispid 1;
  213.     procedure OnClick; dispid 2;
  214.     procedure OnCreate; dispid 3;
  215.     procedure OnDblClick; dispid 5;
  216.     procedure OnDestroy; dispid 6;
  217.     procedure OnDeactivate; dispid 7;
  218.     procedure OnKeyPress(var Key: Smallint); dispid 11;
  219.     procedure OnPaint; dispid 16;
  220.   end;
  221.  
  222. // *********************************************************************//
  223. // Interface: IButtonX
  224. // Flags:     (4416) Dual OleAutomation Dispatchable
  225. // GUID:      {58A2AB1F-0164-11D4-96EC-0060978E1359}
  226. // *********************************************************************//
  227.   IButtonX = interface(IDispatch)
  228.     ['{58A2AB1F-0164-11D4-96EC-0060978E1359}']
  229.     procedure Click; safecall;
  230.     function  Get_Cancel: WordBool; safecall;
  231.     procedure Set_Cancel(Value: WordBool); safecall;
  232.     function  Get_Caption: WideString; safecall;
  233.     procedure Set_Caption(const Value: WideString); safecall;
  234.     function  Get_Default: WordBool; safecall;
  235.     procedure Set_Default(Value: WordBool); safecall;
  236.     function  Get_DragCursor: Smallint; safecall;
  237.     procedure Set_DragCursor(Value: Smallint); safecall;
  238.     function  Get_DragMode: TxDragMode; safecall;
  239.     procedure Set_DragMode(Value: TxDragMode); safecall;
  240.     function  Get_Enabled: WordBool; safecall;
  241.     procedure Set_Enabled(Value: WordBool); safecall;
  242.     function  Get_Font: IFontDisp; safecall;
  243.     procedure _Set_Font(const Value: IFontDisp); safecall;
  244.     procedure Set_Font(var Value: IFontDisp); safecall;
  245.     function  Get_Visible: WordBool; safecall;
  246.     procedure Set_Visible(Value: WordBool); safecall;
  247.     function  Get_DoubleBuffered: WordBool; safecall;
  248.     procedure Set_DoubleBuffered(Value: WordBool); safecall;
  249.     function  Get_VisibleDockClientCount: Integer; safecall;
  250.     function  DrawTextBiDiModeFlagsReadingOnly: Integer; safecall;
  251.     procedure InitiateAction; safecall;
  252.     function  IsRightToLeft: WordBool; safecall;
  253.     function  UseRightToLeftReading: WordBool; safecall;
  254.     function  UseRightToLeftScrollBar: WordBool; safecall;
  255.     function  Get_Cursor: Smallint; safecall;
  256.     procedure Set_Cursor(Value: Smallint); safecall;
  257.     function  Get_MyNewButtonProp: WideString; safecall;
  258.     procedure Set_MyNewButtonProp(const Value: WideString); safecall;
  259.     property Cancel: WordBool read Get_Cancel write Set_Cancel;
  260.     property Caption: WideString read Get_Caption write Set_Caption;
  261.     property Default: WordBool read Get_Default write Set_Default;
  262.     property DragCursor: Smallint read Get_DragCursor write Set_DragCursor;
  263.     property DragMode: TxDragMode read Get_DragMode write Set_DragMode;
  264.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  265.     property Font: IFontDisp read Get_Font write _Set_Font;
  266.     property Visible: WordBool read Get_Visible write Set_Visible;
  267.     property DoubleBuffered: WordBool read Get_DoubleBuffered write Set_DoubleBuffered;
  268.     property VisibleDockClientCount: Integer read Get_VisibleDockClientCount;
  269.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  270.     property MyNewButtonProp: WideString read Get_MyNewButtonProp write Set_MyNewButtonProp;
  271.   end;
  272.  
  273. // *********************************************************************//
  274. // DispIntf:  IButtonXDisp
  275. // Flags:     (4416) Dual OleAutomation Dispatchable
  276. // GUID:      {58A2AB1F-0164-11D4-96EC-0060978E1359}
  277. // *********************************************************************//
  278.   IButtonXDisp = dispinterface
  279.     ['{58A2AB1F-0164-11D4-96EC-0060978E1359}']
  280.     procedure Click; dispid 1;
  281.     property Cancel: WordBool dispid 2;
  282.     property Caption: WideString dispid -518;
  283.     property Default: WordBool dispid 3;
  284.     property DragCursor: Smallint dispid 4;
  285.     property DragMode: TxDragMode dispid 5;
  286.     property Enabled: WordBool dispid -514;
  287.     property Font: IFontDisp dispid -512;
  288.     property Visible: WordBool dispid 6;
  289.     property DoubleBuffered: WordBool dispid 7;
  290.     property VisibleDockClientCount: Integer readonly dispid 8;
  291.     function  DrawTextBiDiModeFlagsReadingOnly: Integer; dispid 10;
  292.     procedure InitiateAction; dispid 11;
  293.     function  IsRightToLeft: WordBool; dispid 12;
  294.     function  UseRightToLeftReading: WordBool; dispid 15;
  295.     function  UseRightToLeftScrollBar: WordBool; dispid 16;
  296.     property Cursor: Smallint dispid 17;
  297.     property MyNewButtonProp: WideString dispid 24;
  298.   end;
  299.  
  300. // *********************************************************************//
  301. // DispIntf:  IButtonXEvents
  302. // Flags:     (0)
  303. // GUID:      {58A2AB21-0164-11D4-96EC-0060978E1359}
  304. // *********************************************************************//
  305.   IButtonXEvents = dispinterface
  306.     ['{58A2AB21-0164-11D4-96EC-0060978E1359}']
  307.     procedure OnClick; dispid 1;
  308.     procedure OnKeyPress(var Key: Smallint); dispid 8;
  309.   end;
  310.  
  311.  
  312. // *********************************************************************//
  313. // OLE Control Proxy class declaration
  314. // Control Name     : TActiveFormX
  315. // Help String      : ActiveFormX Control
  316. // Default Interface: IActiveFormX
  317. // Def. Intf. DISP? : No
  318. // Event   Interface: IActiveFormXEvents
  319. // TypeFlags        : (34) CanCreate Control
  320. // *********************************************************************//
  321.   TActiveFormXOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  322.  
  323.   TActiveFormX = class(TOleControl)
  324.   private
  325.     FOnActivate: TNotifyEvent;
  326.     FOnClick: TNotifyEvent;
  327.     FOnCreate: TNotifyEvent;
  328.     FOnDblClick: TNotifyEvent;
  329.     FOnDestroy: TNotifyEvent;
  330.     FOnDeactivate: TNotifyEvent;
  331.     FOnKeyPress: TActiveFormXOnKeyPress;
  332.     FOnPaint: TNotifyEvent;
  333.     FIntf: IActiveFormX;
  334.     function  GetControlInterface: IActiveFormX;
  335.   protected
  336.     procedure CreateControl;
  337.     procedure InitControlData; override;
  338.   public
  339.     property  ControlInterface: IActiveFormX read GetControlInterface;
  340.     property  DefaultInterface: IActiveFormX read GetControlInterface;
  341.     property Visible: WordBool index 1 read GetWordBoolProp write SetWordBoolProp;
  342.     property Active: WordBool index 9 read GetWordBoolProp;
  343.     property DropTarget: WordBool index 10 read GetWordBoolProp write SetWordBoolProp;
  344.     property HelpFile: WideString index 11 read GetWideStringProp write SetWideStringProp;
  345.     property DoubleBuffered: WordBool index 12 read GetWordBoolProp write SetWordBoolProp;
  346.     property VisibleDockClientCount: Integer index 13 read GetIntegerProp;
  347.     property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp;
  348.   published
  349.     property  ParentColor;
  350.     property  ParentFont;
  351.     property  Align;
  352.     property  DragCursor;
  353.     property  DragMode;
  354.     property  ParentShowHint;
  355.     property  PopupMenu;
  356.     property  ShowHint;
  357.     property  TabOrder;
  358.     property  OnDragDrop;
  359.     property  OnDragOver;
  360.     property  OnEndDrag;
  361.     property  OnEnter;
  362.     property  OnExit;
  363.     property  OnStartDrag;
  364.     property AutoScroll: WordBool index 2 read GetWordBoolProp write SetWordBoolProp stored False;
  365.     property AutoSize: WordBool index 3 read GetWordBoolProp write SetWordBoolProp stored False;
  366.     property AxBorderStyle: TOleEnum index 4 read GetTOleEnumProp write SetTOleEnumProp stored False;
  367.     property Caption: WideString index -518 read GetWideStringProp write SetWideStringProp stored False;
  368.     property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
  369.     property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
  370.     property KeyPreview: WordBool index 5 read GetWordBoolProp write SetWordBoolProp stored False;
  371.     property PixelsPerInch: Integer index 6 read GetIntegerProp write SetIntegerProp stored False;
  372.     property PrintScale: TOleEnum index 7 read GetTOleEnumProp write SetTOleEnumProp stored False;
  373.     property Scaled: WordBool index 8 read GetWordBoolProp write SetWordBoolProp stored False;
  374.     property Cursor: Smallint index 14 read GetSmallintProp write SetSmallintProp stored False;
  375.     property MyNewFormProp: WideString index 15 read GetWideStringProp write SetWideStringProp stored False;
  376.     property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
  377.     property OnClick: TNotifyEvent read FOnClick write FOnClick;
  378.     property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
  379.     property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
  380.     property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
  381.     property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
  382.     property OnKeyPress: TActiveFormXOnKeyPress read FOnKeyPress write FOnKeyPress;
  383.     property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
  384.   end;
  385.  
  386.  
  387. // *********************************************************************//
  388. // OLE Control Proxy class declaration
  389. // Control Name     : TButtonX
  390. // Help String      : ButtonX Control
  391. // Default Interface: IButtonX
  392. // Def. Intf. DISP? : No
  393. // Event   Interface: IButtonXEvents
  394. // TypeFlags        : (34) CanCreate Control
  395. // *********************************************************************//
  396.   TButtonXOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  397.  
  398.   TButtonX = class(TOleControl)
  399.   private
  400.     FOnClick: TNotifyEvent;
  401.     FOnKeyPress: TButtonXOnKeyPress;
  402.     FIntf: IButtonX;
  403.     function  GetControlInterface: IButtonX;
  404.   protected
  405.     procedure CreateControl;
  406.     procedure InitControlData; override;
  407.   public
  408.     procedure Click;
  409.     function  DrawTextBiDiModeFlagsReadingOnly: Integer;
  410.     procedure InitiateAction;
  411.     function  IsRightToLeft: WordBool;
  412.     function  UseRightToLeftReading: WordBool;
  413.     function  UseRightToLeftScrollBar: WordBool;
  414.     property  ControlInterface: IButtonX read GetControlInterface;
  415.     property  DefaultInterface: IButtonX read GetControlInterface;
  416.     property DoubleBuffered: WordBool index 7 read GetWordBoolProp write SetWordBoolProp;
  417.     property VisibleDockClientCount: Integer index 8 read GetIntegerProp;
  418.   published
  419.     property  ParentFont;
  420.     property  TabStop;
  421.     property  Align;
  422.     property  ParentShowHint;
  423.     property  PopupMenu;
  424.     property  ShowHint;
  425.     property  TabOrder;
  426.     property  OnDragDrop;
  427.     property  OnDragOver;
  428.     property  OnEndDrag;
  429.     property  OnEnter;
  430.     property  OnExit;
  431.     property  OnStartDrag;
  432.     property Cancel: WordBool index 2 read GetWordBoolProp write SetWordBoolProp stored False;
  433.     property Caption: WideString index -518 read GetWideStringProp write SetWideStringProp stored False;
  434.     property Default: WordBool index 3 read GetWordBoolProp write SetWordBoolProp stored False;
  435.     property DragCursor: Smallint index 4 read GetSmallintProp write SetSmallintProp stored False;
  436.     property DragMode: TOleEnum index 5 read GetTOleEnumProp write SetTOleEnumProp stored False;
  437.     property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp stored False;
  438.     property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
  439.     property Visible: WordBool index 6 read GetWordBoolProp write SetWordBoolProp stored False;
  440.     property Cursor: Smallint index 17 read GetSmallintProp write SetSmallintProp stored False;
  441.     property MyNewButtonProp: WideString index 24 read GetWideStringProp write SetWideStringProp stored False;
  442.     property OnClick: TNotifyEvent read FOnClick write FOnClick;
  443.     property OnKeyPress: TButtonXOnKeyPress read FOnKeyPress write FOnKeyPress;
  444.   end;
  445.  
  446. procedure Register;
  447.  
  448. implementation
  449.  
  450. uses ComObj;
  451.  
  452. procedure TActiveFormX.InitControlData;
  453. const
  454.   CEventDispIDs: array [0..7] of DWORD = (
  455.     $00000001, $00000002, $00000003, $00000005, $00000006, $00000007,
  456.     $0000000B, $00000010);
  457.   CTFontIDs: array [0..0] of DWORD = (
  458.     $FFFFFE00);
  459.   CControlData: TControlData2 = (
  460.     ClassID: '{58A2AB10-0164-11D4-96EC-0060978E1359}';
  461.     EventIID: '{58A2AB0E-0164-11D4-96EC-0060978E1359}';
  462.     EventCount: 8;
  463.     EventDispIDs: @CEventDispIDs;
  464.     LicenseKey: nil (*HR:$00000000*);
  465.     Flags: $0000001D;
  466.     Version: 401;
  467.     FontCount: 1;
  468.     FontIDs: @CTFontIDs);
  469. begin
  470.   ControlData := @CControlData;
  471.   TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnActivate) - Cardinal(Self);
  472. end;
  473.  
  474. procedure TActiveFormX.CreateControl;
  475.  
  476.   procedure DoCreate;
  477.   begin
  478.     FIntf := IUnknown(OleObject) as IActiveFormX;
  479.   end;
  480.  
  481. begin
  482.   if FIntf = nil then DoCreate;
  483. end;
  484.  
  485. function TActiveFormX.GetControlInterface: IActiveFormX;
  486. begin
  487.   CreateControl;
  488.   Result := FIntf;
  489. end;
  490.  
  491. procedure TButtonX.InitControlData;
  492. const
  493.   CEventDispIDs: array [0..1] of DWORD = (
  494.     $00000001, $00000008);
  495.   CTFontIDs: array [0..0] of DWORD = (
  496.     $FFFFFE00);
  497.   CControlData: TControlData2 = (
  498.     ClassID: '{58A2AB23-0164-11D4-96EC-0060978E1359}';
  499.     EventIID: '{58A2AB21-0164-11D4-96EC-0060978E1359}';
  500.     EventCount: 2;
  501.     EventDispIDs: @CEventDispIDs;
  502.     LicenseKey: nil (*HR:$00000000*);
  503.     Flags: $0000001C;
  504.     Version: 401;
  505.     FontCount: 1;
  506.     FontIDs: @CTFontIDs);
  507. begin
  508.   ControlData := @CControlData;
  509.   TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnClick) - Cardinal(Self);
  510. end;
  511.  
  512. procedure TButtonX.CreateControl;
  513.  
  514.   procedure DoCreate;
  515.   begin
  516.     FIntf := IUnknown(OleObject) as IButtonX;
  517.   end;
  518.  
  519. begin
  520.   if FIntf = nil then DoCreate;
  521. end;
  522.  
  523. function TButtonX.GetControlInterface: IButtonX;
  524. begin
  525.   CreateControl;
  526.   Result := FIntf;
  527. end;
  528.  
  529. procedure TButtonX.Click;
  530. begin
  531.   DefaultInterface.Click;
  532. end;
  533.  
  534. function  TButtonX.DrawTextBiDiModeFlagsReadingOnly: Integer;
  535. begin
  536.   Result := DefaultInterface.DrawTextBiDiModeFlagsReadingOnly;
  537. end;
  538.  
  539. procedure TButtonX.InitiateAction;
  540. begin
  541.   DefaultInterface.InitiateAction;
  542. end;
  543.  
  544. function  TButtonX.IsRightToLeft: WordBool;
  545. begin
  546.   Result := DefaultInterface.IsRightToLeft;
  547. end;
  548.  
  549. function  TButtonX.UseRightToLeftReading: WordBool;
  550. begin
  551.   Result := DefaultInterface.UseRightToLeftReading;
  552. end;
  553.  
  554. function  TButtonX.UseRightToLeftScrollBar: WordBool;
  555. begin
  556.   Result := DefaultInterface.UseRightToLeftScrollBar;
  557. end;
  558.  
  559. procedure Register;
  560. begin
  561.   RegisterComponents('ActiveX',[TActiveFormX, TButtonX]);
  562. end;
  563.  
  564. end.
  565.